#ifndef _GEOMETRY_H 
#define _GEOMETRY_H

#include "GlobalDefines.h"
#include <fstream>

class Geometry
{
public:
	virtual void ReadGeometry(std::string GeoFileName, int buffer) = 0;
};

class MoM_Geometry:public Geometry
{
public:
	friend class MoM_Partition;
	friend class MoM_Solver;
	friend class RCS;
	virtual void ReadGeometry(std::string GeoFileName, int buffer);
private:
	void ImportNode();
	void ImportPatch();
	void ImportEdge();
	void Initial();
	void SetCoef();
	void FillGrid(int Rule, int IntegralNum, const blitz::TinyVector<real_data ,16>& AxisU,
		const blitz::TinyVector<real_data,16>& AxisV, const blitz::TinyVector<real_data,16>& Weight);


private:
	std::ifstream fin;												// Geometry File's Access

	blitz::Array<Position3D,1> Node, Patch_Ctr, Patch_Norm;			// Geometries' information
	blitz::Array<Int4,1> Edge;
	blitz::Array<Int3,1> Patch;
	blitz::Array<real_data,1> Edge_Length, Patch_Area;	
	blitz::TinyVector<int, 2> Grid_Num;
	blitz::Array <real_data, 2> GdPtWt;
	blitz::Array <real_data, 2> GdPtCoef1, GdPtCoef2, GdPtCoef3;
	blitz::Array<Position3D, 3> R;
	int Node_Num, Patch_Num, Edge_Num;
	real_data Edge_Max, Near2;
	int Buffer_Layers;
	blitz::Array<dComplex, 1> I;									// Unknowns' coefficients
};

#endif